package kr.blogspot.stiner01.moduletutorial;

import java.util.Random;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class RenderViewTest extends Activity
{
    class RenderView extends View
    {
        Random rand = new Random();
        
        //double d = 0.0f;
        
        public RenderView(Context context)
        {
            super(context);
        }
        
        protected void onDraw(Canvas canvas)
        {
            //canvas.drawCircle(rand.nextInt(this.getWidth()), rand.nextInt(this.getHeight()), rand.nextInt(100), new Paint(Color.BLACK));
            //
            //float x = ((float)Math.sin(d) * 100) + (this.getWidth() / 2.0f);
            //float y = ((float)Math.cos(d) * 100) + (this.getHeight() / 2.0f);
            //
            //canvas.drawCircle(x, y, 10, new Paint(Color.BLACK));
            //d += 0.1;
            
            canvas.drawRGB(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
            
            invalidate();
        }
    }
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        setContentView(new RenderView(this));
    }
}
